#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'Python3提供了新的语法'

import asyncio

async def hello():
    print('Hello World')
    r = await asyncio.sleep(1)
    print('Hello world')

if __name__ == '__main__':
    try:
        # 获取ExentLoop：
        loop = asyncio.get_event_loop()
        # 执行corountine
        loop.run_until_complete(hello())
        # task = [hello(),hello(),hello()]
        # loop.run_until_complete(asyncio.wait(task))
    except Exception as e:
        print(e)
    finally:
        loop.close()